clear
set more off
set matsize 4000
cd "/Users/alee87/Dropbox/Job Reservation/Replication"




clear
use "36151-0001-Data copy.dta"


merge m:1 IDHH using "36151-0002-Data copy.dta"
drop MB* SM* MG* FM* OG* QC* FU* WA* MP6* CD*  OH* MI* DB* CO*  AN* FM* AP* AD* _merge

merge m:1  ID12ANM STATEID using "ihds_caste.dta"
drop _merge
replace newcaste=ID12ANM if newcaste==""
replace newcaste="BHUDDIST" if newcaste=="BHUDDIST "



merge m:1  newcaste STATEID using "caste_level.dta"
drop _merge sc st obc

merge m:1  newcaste STATEID using "castelist.dta"
drop _merge sname
recode inlist (.=0)

merge m:1 STATEID using "states_notes.dta"
drop _merge

drop if obc_res_year==.


*****Make the Independent variables
rename RO5 age 
rename RO3 male
recode male (2=0)

gen married=RO6
recode married (0=1)
replace married=0 if married>1

recode HS3Y (.=2012)
gen birthyear =HS3Y-age

gen year18=birthyear+17

gen obc=0
replace obc=1 if ID13==3


replace obc=0 if lateaddition>=year18 &obc==1&lateaddition!=.

gen oldstate=state
replace oldstate="Bihar" if state=="Jharkhand"
replace oldstate="Uttar Pradesh" if state=="Uttarakhand"
replace oldstate="Madhya Pradesh" if state=="Chhattisgarh"

egen test1=mean(obc), by(oldstate)
egen test2=mean(obc), by(state)

gen stateobc=test1*100
replace stateobc=test2*100 if year>2000
drop test* state_caste_count

gen state_res_year=0
replace state_res_year=1 if year18>=obc_res_year

drop if year18>HS3Y
drop if year18<1964

*DDD
gen period=0
replace period =1 if year18>1993

gen stategrp=0
replace stategrp =1 if obc_res_year>1990

gen castgrp=0
replace castgrp=1 if obc==1


         gen nationaltreat=0
		 replace nationaltreat=1 if period==1 &castgr ==1
		 
** DDD FE



gen caste4=0
replace caste4=1 if ID13==4 
replace caste4=2 if ID13==5
replace caste4=3 if obc==1

gen mandalcasteyear=0
replace mandalcasteyear=1 if period==1 &stategrp==1&castgrp==1
replace mandalcasteyear=. if year18==1991 &obc_res_year==1991&castgrp==1
replace mandalcasteyear=. if year18==1992 &obc_res_year==1991&castgrp==1
replace mandalcasteyear=. if year18==1993 &obc_res_year==1991&castgrp==1

gen yearmandal=0
replace yearmandal=1 if period==1 &stategrp==1
replace yearmandal=. if year18==1991 &obc_res_year==1991
replace yearmandal=. if year18==1992 &obc_res_year==1991
replace yearmandal=. if year18==1993 &obc_res_year==1991


gen statecaste=STATEID*10+ caste4
gen casteyear=year18*10+ caste4
gen stateyear=STATEID*100+(year18-1947)
gen stateperiod=STATEID*10+(period)



*FE
gen reserved=0
replace reserved=1 if obc==1 &state_res_year==1

gen unaffected=0
replace unaffected=1 if state=="Kerala"
replace unaffected=1 if state=="Karnataka"
replace unaffected=1 if state=="Gujarat"
replace unaffected=1 if state=="Tamil Nadu"
replace unaffected=1 if state=="Andhra Pradesh"

*continuous
gen res_prop=0
replace res_prop=obcquota/stateobc if state_res_year==1
replace res_prop=20/stateobc if state=="Bihar" &year18 >=1977  &year18<1992
replace res_prop=20/stateobc if state=="Jharkhand" &year18>=1977  &year18<1993
replace res_prop=33/stateobc if state=="Jharkhand" &year18>= 1992 &year18<2000
replace res_prop=35/stateobc if state=="Karnataka" &year18>=1977  &year18<1996
replace res_prop=55/stateobc if state=="Karnataka" &year18>=1986  &year18<1994
replace res_prop=18/stateobc if state=="Maharashtra" &year18>=1947  &year18<1994
replace res_prop=30/stateobc if state=="Maharashtra" &year18>= 1994 &year18<1995
replace res_prop=5/stateobc if state=="Punjab" &year18>=1964  &year18<1993
replace res_prop=25/stateobc if state=="Tamil Nadu" &year18>=1947  &year18<1971
replace res_prop=31/stateobc if state=="Tamil Nadu" &year18>=1971  &year18<1980
replace res_prop=27/stateobc if state=="Uttarakhand" &year18>=1993  &year18<2000


gen res_prop_obc=obc*res_prop

*ages
do "alternateage.do"

***movement
*individual movement
gen one=1
egen state_caste_count=total(one), by(newcaste STATEID)

gen yscaste_obc=0
replace yscaste_obc=1 if ID13==3
egen scaste_obc=total(yscaste_obc), by(newcaste STATEID)
gen yscaste_sc=0
replace yscaste_sc=1 if ID13==4
egen scaste_sc=total(yscaste_sc), by(newcaste STATEID)
gen yscaste_st=0
replace yscaste_st=1 if ID13==5
egen scaste_st=total(yscaste_st), by(newcaste STATEID)
drop ys*

gen jati_prop_obc=scaste_obc/state_caste_count
gen jati_prop_sc=scaste_sc/state_caste_count
gen jati_prop_st=scaste_st/state_caste_count
gen jati_prop_gen=1-jati_prop_st-jati_prop_sc-jati_prop_obc

gen jaticaste=.
replace jaticaste=1 if jati_prop_gen>.9
replace jaticaste=2 if jati_prop_st>.9
replace jaticaste=3 if jati_prop_sc>.9
replace jaticaste=4 if jati_prop_obc>.9

gen statejcaste=STATEID*10+ jaticaste
gen jcasteyear=year18*10+ jaticaste

gen caste1j=0
replace caste1j=1 if jaticaste==4
replace caste1j=. if jaticaste==.

gen anomalouscat=0
replace anomalouscat=1 if jati_prop_gen>.5 &caste4!=0
replace anomalouscat=1 if jati_prop_st>.5 &caste4!=2
replace anomalouscat=1 if jati_prop_sc>.5 &caste4!=1
replace anomalouscat=1 if jati_prop_obc>.5 &caste4!=3
replace anomalouscat=1 if state_caste_count<3

gen jmandalcasteyear=0
replace jmandalcasteyear=1 if period==1 &stategrp==1&jaticaste==4
replace jmandalcasteyear=. if year18==1991 &obc_res_year==1991&jaticaste==4
replace jmandalcasteyear=. if year18==1992 &obc_res_year==1991&jaticaste==4
replace jmandalcasteyear=. if year18==1993 &obc_res_year==1991&jaticaste==4
replace jmandalcasteyear=. if jaticaste==.

gen res_prop_jobc=0
replace  res_prop_jobc =res_prop if jaticaste==4
replace res_prop_jobc=. if jaticaste==.


*subquota
gen mbc=0
replace mbc=1 if obcsubquota!=""
egen statembc=mean(mbc), by (oldstate)

gen caste5=caste4
replace caste5=5 if obcsubquota!=""

gen statecaste5=STATEID*10+ caste5
gen caste5year=year18*10+ caste5

gen sub_res_prop=0
replace sub_res_prop=mbcsubquotapercent/(statembc*100) if  year18>= mbcsubquota
replace sub_res_prop=. if state=="Jharkhand" &year18>2000

gen sub_res_prop_mbc=0
replace sub_res_prop_mbc=mbcsubquotapercent/(statembc*100) if  year18>= mbcsubquota &obcsubquota!=""
replace sub_res_prop_mbc=. if state=="Jharkhand" &year18>2000

gen zperiod=0
replace zperiod =1 if year18>1988

gen zstategrp=.
replace zstategrp =1 if state=="Tamil Nadu"
replace zstategrp =0 if state=="Kerala"
replace zstategrp =0 if state=="Andhra Pradesh"
replace zstategrp =0 if state=="Gujarat"
replace zstategrp =0 if state=="Maharashtra"


gen zcastgrp=0
replace zcastgrp=1 if obcsubquota!=""

gen mbc_quota=0
replace mbc_quota=1 if sub_res_prop_mbc>0 &sub_res_prop_mbc<1000


****the dependent variables

*education and ses

rename ED2 literate

rename ED6 yearsofeducation

gen english=0
replace english=1 if ED3>1
replace english=. if ED3==.

gen attendedcollege =0
replace attend=1 if yearsof>12
replace attend=. if yearsof==.
replace attend=. if age<21

gen graduatedcollege =0
replace graduatedcollege=1 if yearsof>14
replace graduatedcollege=. if yearsof==.
replace graduatedcollege=. if age<23

gen income=INCOME
*replace income=1 if income<1
gen loghhincome=log(income) 
replace loghhincome =. if  RO4!=1

gen professionalocc=0
replace professionalocc=1 if WS4<51
replace professionalocc=. if WS4==.
replace professionalocc=. if age<25

gen govjob=0
replace govjob=1 if  WS14==1
replace govjob=. if  WS14>3
replace govjob=. if  WS14==.
replace govjob=. if age<23|age>60

gen formalsect=0
replace formalsect=1 if  RO7>6&RO7<10
replace  formalsect=. if age<23|age>60
replace  formalsect=. if RO7>10

recode WS10AN WS12 WS11MEALSRS  WS11HOUSERS WSEARNNONAG WSEARNAG WSEARNNREGA(.=0)
gen logwages=log( WSEARNNONAG+WSEARNAG)

rename ASSETS assets
replace assets=. if  RO4!=1


drop CG1A CG9 CG10 CGM CG11 CG24 CG25 CG4
factor CG*
predict factor1
replace factor1=. if  RO4!=1

sum professionalocc loghhincome  graduatedcollege attendedcollege english  yearsofeducation literate  factor1

**contacts 
egen numberofcontacts=rsum(SN2*)
replace numberofcontacts=numberofcontacts-SN2G1-SN2G2-SN2H1-SN2H2-SN2K1-SN2K2
gen contactbinary=0
replace contactbinary=1 if numberofcontacts>0

egen numberofseniorcontacts=rsum(SN2A1 SN2A2 SN2C1 SN2C2 SN2E1 SN2E2 SN2I1 SN2I2 )
gen seniorcontactbinary=0
replace seniorcontactbinary=1 if numberofseniorcontacts>0

egen numberofcontacts_caste=rsum(SN2*1)
replace numberofcontacts_caste=numberofcontacts-SN2G1-SN2H1-SN2K1
gen contactbinary_caste=0
replace contactbinary_caste=1 if numberofcontacts_caste>0

egen numberofseniorcontacts_caste=rsum(SN2A1  SN2C1  SN2E1  SN2I1 )
gen seniorcontactbinary_caste=0
replace seniorcontactbinary_caste=1 if numberofseniorcontacts_caste>0
replace seniorcontactbinary_caste=. if EDUC7>12

sum seniorcontactbinary contactbinary seniorcontactbinary_caste contactbinary_caste





***conditioning effects 

gen test=.
replace test= yearsofeducation  if RO4==1&male==1
egen edyearshead=mean(test) ,by(IDHH)
drop test

gen edyearsfather=.
replace edyearsfather=ID18C if RO4<3
replace edyearsfather=edyearshead if RO4>2 &RO4<5

gen edfath=0
egen statefather=mean(edyearsfather), by(STATEID)
replace edfath=1 if edyearsfather>9
replace edfath=. if edyearsfather==.

egen castemeaneducation=mean(years) , by(newcaste state period)
replace castemeaneducation=. if period==1
egen catmeaneducation=mean(years) , by(caste4 state period)
replace catmeaneducation=. if period==1

egen caste_mean_education=mean(castemeaneducation) , by(newcaste state)
egen cat_mean_education=mean(catmeaneducation) , by(newcaste state)
drop castemeaneducation catmeaneducation


gen educatedcaste =0
replace educatedcaste =1 if caste_mean_education>cat_mean_education
rename educatedcaste edcaste
replace edcaste=0 if castgrp==0

sum edcaste  edfath

gen edstatecaste=0
replace edstatecaste=statecaste if edfath==1
gen edstateyear=0
replace edstateyear=stateyear if edfath==1
gen edcasteyear=0
replace edcasteyear=casteyear if edfath==1

gen x_int_north_obc_post_edfath=x_int_north_obc_post*edfath

gen q_int_north_obc_post_edfath=q_int_north_obc_post*edfath

gen u_int_north_obc_post_edfath=u_int_north_obc_post*edfath

gen v_int_north_obc_post_edfath=v_int_north_obc_post*edfath


***attitudes
rename ME8 casteassociation

rename TR1 casteconflict
recode casteconf (2=1) (3=0)

gen untouchabityexperience=TR4A
replace untouchabityexperience =. if caste4==2
replace untouchabityexperience =. if caste4==1
replace untouchabityexperience =. if ID11!=1

rename MP2A intercastemarriage

rename RC3D castecertificate


sum  castecertificate  intercastemarriage untouchabityexperience  casteconflict casteassociation

**interactions
gen int_obc=castgr 
gen int_post94=period
gen int_northstate=stategr
gen int_obc_north=castgr *stategr
gen int_obc_post94=castgr*period
gen int_north_post94=stategr*period
gen int_north_obc_post=castgr *stategr*period

gen jint_obc=caste1j 
gen jint_post94=period
gen jint_northstate=stategr
gen jint_obc_north=caste1j *stategr
gen jint_obc_post94=caste1j*period
gen jint_north_post94=stategr*period
gen jint_north_obc_post=caste1j *stategr*period

gen int_obc_post_edfath=int_obc_post*edfath
gen int_north_obc_post_edfath=int_north_obc_post*edfath

label var  int_obc "OBC Caste"
label var  int_post94  "Post 1994"
label var  int_northstate  "Mandal State"
label var  int_obc_north  "OBC Caste*Mandal State"
label var  int_obc_post94  "OBC*Post 94"
label var  int_north_post94  "Post 94*Mandal State"
label var  int_north_obc_post "OBC*Post 94*Mandal State"
label var  res_prop_obc "OBC*Post 94*OBC Reservation/OBC Pop."


label var  x_int_obc "OBC Caste"
label var  x_int_post94  "Post 1994"
label var  x_int_northstate  "Mandal State"
label var  x_int_obc_north  "OBC Caste*Mandal State"
label var  x_int_obc_post94  "OBC*Post 94"
label var  x_int_north_post94  "Post 94*Mandal State"
label var  x_int_north_obc_post "OBC*Post 94*Mandal State"


label var  q_int_obc "OBC Caste"
label var  q_int_post94  "Post 1994"
label var  q_int_northstate  "Mandal State"
label var  q_int_obc_north  "OBC Caste*Mandal State"
label var  q_int_obc_post94  "OBC*Post 94"
label var  q_int_north_post94  "Post 94*Mandal State"
label var  q_int_north_obc_post "OBC*Post 94*Mandal State"

label var  v_int_obc "OBC Caste"
label var  v_int_post94  "Post 1994"
label var  v_int_northstate  "Mandal State"
label var  v_int_obc_north  "OBC Caste*Mandal State"
label var  v_int_obc_post94  "OBC*Post 94"
label var  v_int_north_post94  "Post 94*Mandal State"
label var  v_int_north_obc_post "OBC*Post 94*Mandal State"


label var  u_int_obc "OBC Caste"
label var  u_int_post94  "Post 1994"
label var  u_int_northstate  "Mandal State"
label var  u_int_obc_north  "OBC Caste*Mandal State"
label var  u_int_obc_post94  "OBC*Post 94"
label var  u_int_north_post94  "Post 94*Mandal State"
label var  u_int_north_obc_post "OBC*Post 94*Mandal State"



label var  jint_obc "OBC Caste"
label var  jint_post94  "Post 1994"
label var  jint_northstate  "Mandal State"
label var  jint_obc_north  "OBC Caste*Mandal State"
label var  jint_obc_post94  "OBC*Post 94"
label var  jint_north_post94  "Post 94*Mandal State"
label var  jint_north_obc_post "OBC*Post 94*Mandal State"

**graphing

     *****FIGURE 1****
twoway (lpolyci yearsof year18 if  year18>1979 &year18<2008 &int_northstate==1&int_obc==0, xline(1994, lstyle(dot  )) xline(1994, lstyle(solid  )) clpattern(solid) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)) (lpolyci yearsof year18 if  year18>1979 &year18<2008 &int_northstate==1&int_obc==1, clpattern(dash) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)), legend(order(2 "General" 4 "OBC")) scheme(s1mono)  xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Average Years of Education}) title({stSerif: Years of Education by Caste Category and Year})
graph2tex,  epsfile(posttrend_edu) 
twoway (lpolyci govjob year18 if  year18>1979 &year18<2008 &int_northstate==1&int_obc==0, xline(1994, lstyle(dot  )) xline(1994, lstyle(solid  )) clpattern(solid) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)) (lpolyci govjob year18 if  year18>1979 &year18<2008 &int_northstate==1&int_obc==1, clpattern(dash) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)), legend(order(2 "General" 4 "OBC ")) scheme(s1mono)  xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Prop. with Government Job}) title({stSerif: Government Employment by Caste Category and Year})
graph2tex,  epsfile(posttrend_formal) 
twoway (lpolyci yearsof year18 if  year18>1979 &year18<2008 &int_northstate==0&int_obc==0, xline(1994, lstyle(dot  )) xline(1994, lstyle(solid  )) clpattern(solid) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)) (lpolyci yearsof year18 if  year18>1979 &year18<2008 &int_northstate==0&int_obc==1, clpattern(dash) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)), legend(order(2 "General" 4 "OBC")) scheme(s1mono)  xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Average Years of Education}) title({stSerif: Years of Education by Caste Category and Year})
graph2tex,  epsfile(nm_posttrend_edu) 
twoway (lpolyci govjob year18 if  year18>1979 &year18<2008 &int_northstate==0&int_obc==0, xline(1994, lstyle(dot  )) xline(1994, lstyle(solid  )) clpattern(solid) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)) (lpolyci govjob year18 if  year18>1979 &year18<2008 &int_northstate==0&int_obc==1, clpattern(dash) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)), legend(order(2 "General" 4 "OBC ")) scheme(s1mono)  xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Prop. with Government Job}) title({stSerif: Government Employment by Caste Category and Year})
graph2tex,  epsfile(nm_posttrend_formal) 




    *****FIGURE 2****
twoway (lpolyci seniorcontactbinary_caste year18 if  year18>1979 &year18<2012 &int_northstate==1&int_obc==0, xline(1994, lstyle(dot  )) xline(1994, lstyle(solid  )) clpattern(solid) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)) (lpolyci seniorcontactbinary_caste year18 if  year18>1979 &year18<2012 &int_northstate==1&int_obc==1, clpattern(dash) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)), legend(order(2 "General" 4 "OBC ")) scheme(s1mono)  xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Prop. with Same Jati Gov. Contact }) title({stSerif: Senior Government Contact by Caste Category and Year})
graph2tex,  epsfile(postrend_contact) 
twoway (lpolyci seniorcontactbinary_caste year18 if  year18>1979 &year18<2012 &int_northstate==0&int_obc==0, xline(1994, lstyle(dot  )) xline(1994, lstyle(solid  )) clpattern(solid) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)) (lpolyci seniorcontactbinary_caste year18 if  year18>1979 &year18<2012 &int_northstate==0&int_obc==1, clpattern(dash) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)), legend(order(2 "General" 4 "OBC ")) scheme(s1mono)  xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Prop. with Same Jati Gov. Contact }) title({stSerif: Senior Government Contact by Caste Category and Year})
graph2tex,  epsfile(nm_postrend_contact) 

*twoway (lpolyci yearsof year18 if  year18>1979 &year18<2008 &int_northstate==1&int_obc==0&edfath==1, xline(1994, lstyle(dot  )) xline(1994, lstyle(solid  )) clpattern(solid) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)) (lpolyci yearsof year18 if  year18>1979 &year18<2008 &int_northstate==1&int_obc==1&edfath==1, clpattern(dash) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)), legend(order(2 "General" 4 "OBC ")) scheme(s1mono)  xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Average Years of Education}) title({stSerif: Years of Education of Educated Father's Children by Caste Category and Year})
*graph2tex,  epsfile(postrend_fathedu) 
*twoway (lpolyci yearsof year18 if  year18>1979 &year18<2008 &int_northstate==0&int_obc==0&edfath==1, xline(1994, lstyle(dot  )) xline(1994, lstyle(solid  )) clpattern(solid) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)) (lpolyci yearsof year18 if  year18>1979 &year18<2008 &int_northstate==0&int_obc==1&edfath==1, clpattern(dash) fcolor(none) blcolor(black) blwidth(thin) blpattern(dot)), legend(order(2 "General" 4 "OBC ")) scheme(s1mono)  xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Average Years of Education}) title({stSerif: Years of Education of Educated Father's Children by Caste Category and Year})
*graph2tex,  epsfile(nm_postrend_fathedu) 


***DDD, raw data
***FIGURES A1-A3**
preserve
drop if year18<1979
replace untouch=. if ID11==.
replace casteass=. if ID11==.

collapse (mean)  yearsofeducation formal literate logwages casteass seniorcontactbinary_caste  castecertificate untouch govjob, by(year18 castgr stategr)

twoway (line years year18 if castgr==1&stategr==0, xline(1994, lstyle(dot)) lcolor(black) lpattern(solid )) (line years year18 if castgr==0&stategr==0, xline(1994)  lcolor(black ) lpattern(dash )) , legend(order(1 2 ) label(1 "OBC") label(2 "General")) scheme(s1mono) xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Average Years of Education}) title({stSerif:  Education by Caste Category})
graph2tex,  epsfile(DDDyears0) 
twoway (line seniorcontactbinary_caste year18 if castgr==1&stategr==0, xline(1994, lstyle(dot)) lcolor(black) lpattern(solid )) (line seniorcontactbinary_caste year18 if castgr==0&stategr==0, xline(1994)  lcolor(black ) lpattern(dash )), legend(order(1 2 ) label(1 "OBC") label(2 "General")) scheme(s1mono) xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Prop. with Prof. Contact}) title({stSerif:  Within-Category Contacts by Caste Category})
graph2tex,  epsfile(DDDcontact0) 
twoway (line govjob year18 if castgr==1&stategr==0, xline(1994, lstyle(dot  )) lcolor(black) lpattern(solid )) (line govjob  year18 if castgr==0&stategr==0, xline(1994)  lcolor(black ) lpattern(dash )), legend(order(1 2 ) label(1 "OBC") label(2 "General")) scheme(s1mono) xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Government Employment}) title({stSerif: Government Employment by Caste Category})
graph2tex,  epsfile(DDDformal0)


twoway (line years year18 if castgr==1&stategr==1, xline(1994, lstyle(dot)) lcolor(black) lpattern(solid )) (line years year18 if castgr==0&stategr==1, xline(1994)  lcolor(black ) lpattern(dash )), legend(order(1 2 ) label(1 "OBC") label(2 "General")) scheme(s1mono) xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Average Years of Education}) title({stSerif:  Education by Caste Category})
graph2tex,  epsfile(DDDyears1) 
twoway (line seniorcontactbinary_caste year18 if castgr==1&stategr==1, xline(1994, lstyle(dot)) lcolor(black) lpattern(solid )) (line seniorcontactbinary_caste year18 if castgr==0&stategr==1, xline(1994)  lcolor(black ) lpattern(dash )), legend(order(1 2 ) label(1 "OBC") label(2 "General")) scheme(s1mono) xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Prop. with Prof. Contact}) title({stSerif:  Within-Category Contacts by Caste Category})
graph2tex,  epsfile(DDDcontact1) 
twoway (line govjob year18 if castgr==1&stategr==1, xline(1994, lstyle(dot  )) lcolor(black) lpattern(solid )) (line govjob  year18 if castgr==0&stategr==1, xline(1994)  lcolor(black ) lpattern(dash )), legend(order(1 2 ) label(1 "OBC") label(2 "General")) scheme(s1mono) xtitle({stSerif: Year Turned 17}) ytitle({stSerif: Government Employment}) title({stSerif: Government Employment by Caste Category})
graph2tex,  epsfile(DDDformal1)
restore

